package com.feifan.monthhelper.bean.db;

import android.arch.persistence.room.Entity;
import android.arch.persistence.room.Ignore;
import android.arch.persistence.room.PrimaryKey;
import android.arch.persistence.room.TypeConverters;

import com.feifan.monthhelper.db.conventer.DateConverter;

import java.util.Date;

/**
 * 月经记录
 */
@Entity(tableName = "menstrual_record")
@TypeConverters({DateConverter.class})
public class MenstrualRecordBean  implements Comparable<MenstrualRecordBean>{
    @PrimaryKey(autoGenerate = true)
    public int id;
    public Date start_date;
    public Date end_date;

    public MenstrualRecordBean() {
    }

    @Override
    public int compareTo(MenstrualRecordBean o) {
        //反序
        return o.start_date.compareTo(start_date);
    }
}
